package com.cjx.api.service.inner;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cjx.api.model.entity.User;
import com.cjx.api.service.UserService;
import com.cjx.common.service.inner.InterfaceInfoServiceInner;
import com.cjx.common.service.inner.UserServiceInner;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

/**
 * @author cjx
 * @description
 * @createDate 2024/5/14 13:26
 **/
@DubboService
public class UserServiceInnerImpl implements UserServiceInner {

    @Resource
    private UserService userService;

    @Override
    public com.cjx.common.model.entity.User getUserByAssertKey(String assertKey) {
        User user = userService.getOne(new LambdaQueryWrapper<User>().eq(User::getAccessKey, assertKey));
        return BeanUtil.copyProperties(user, com.cjx.common.model.entity.User.class);
    }
}
